<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>购买记录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1  maximum-scale=1 user-scalable=no">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="HandheldFriendly" content="True">

    <link rel="stylesheet" href="/css/materialize.css">
    <link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/normalize.css">
    <link rel="stylesheet" href="/css/owl.carousel.css">
    <link rel="stylesheet" href="/css/owl.theme.css">
    <link rel="stylesheet" href="/css/owl.transitions.css">
    <link rel="stylesheet" href="/css/fakeLoader.css">
    <link rel="stylesheet" href="/css/animate.css">
    <link rel="stylesheet" href="/css/magnific-popup.css">
    <link rel="stylesheet" href="/css/style.css">

    <link rel="shortcut icon" href="/img/favicon.png">

</head>
<body>

<!-- wishlist -->
<div class="wishlist section">
    <div class="container">
        <div class="pages-head">
            <h3>购买记录</h3>
        </div>

        <div class="content" th:each="sell,stat: ${sells}">
            <div class="cart-1">
                <div class="row">
                    <div class="col s5">
                        <h5>购买日期</h5>
                    </div>
                    <div class="col s7">
                        <h5 th:text="${#dates.format(sell.createDate,'yyyy-MM-dd')}" ></h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col s5">
                        <h5>购买型号</h5>
                    </div>
                    <div class="col s7">
                        <h5 th:text="${sell.model}"></h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col s5">
                        <h5>购买数量</h5>
                    </div>
                    <div class="col s7">
                        <h5 th:text="${sell.count}"></h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col s5">
                        <h5>购买单价</h5>
                    </div>
                    <div class="col s7">
                        <h5 th:text="${sell.price}"></h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col s5">
                        <h5>是否开票</h5>
                    </div>
                    <div class="col s7">
                        <h5 th:text="${sell.invoice==1?'已开票':(sell.invoice==0?'未开票':'申请中')}"></h5>
                    </div>
                </div>
                <div class="row" th:if="${sell.invoice ==0}">
                    <div class="col 12">
                        <button class="btn button-default apply" th:attr="record-id=${sell.id}">提交开票申请</button>
                    </div>
                </div>
            </div>
            <div class="divider"></div>
        </div>
    </div>
</div>
<!-- end wishlist -->


<!-- scripts -->
<script src="/js/jquery.min.js"></script>
<script src="/js/materialize.min.js"></script>
<script src="/js/owl.carousel.min.js"></script>
<script src="/js/fakeLoader.min.js"></script>
<script src="/js/animatedModal.min.js"></script>
<script src="/js/main.js"></script>
<script>
    $(document).ready(function(){
        var openid='ocj3U6G1nzqdfDS-9GWn18N4rujQ';

        $(".apply").on("click", function(){
            var record_id = $(this).attr('record-id');
            window.location.href = "/personal/buy/apply?openid="+openid+"&recordid="+record_id;
        });

    });
</script>
</body>
</html>